@if(Session::has('errors'))
<div id="panel-error" class="row">
	<div class="col-md-12">
		<div class="panel panel-red panel-minimal">
			<header class="panel-heading">{{trans('form.error')}}</header>
			<div class="panel-body">
				@foreach($errors as $error)
					{{$error['message']}} <br />
				@endforeach
			</div>
		</div>
	</div>
</div>
@endif

<div class='row'>
	<div class='col-md-12'>
		<div class="panel panel-default">
			<!--<header class="panel-heading">{{ trans('taxonomy.create') }}</header>-->
			<div class="panel-body">
				{{Form::open(array('method' => 'post', 'class' => 'form-horizontal', 'url' => 'admin/' . $type . '/save'))}}
					<div class="form-group">
						{{Form::label('taxonomy', trans($type . '.taxonomy'), array('class' => 'col-sm-2 control-label'))}}
						<div class="col-sm-5">
							{{Form::text('taxonomy', (isset($taxonomy->taxonomy))? $taxonomy->taxonomy : Input::old('taxonomy', null), array('class' => 'form-control', 'id' => 'taxonomy', 'placeholder' => trans('type.taxonomy')))}}
						</div>
					</div>

					<div class="form-group">
						{{Form::label('order', trans('type.order'), array('class' => 'col-sm-2 control-label'))}}
						<div class="col-sm-5">
							{{Form::text('order', (isset($taxonomy->order))? $taxonomy->order : Input::old('order', 0), array('class' => 'form-control', 'id' => 'order', 'placeholder' => trans('type.order')))}}
						</div>
					</div>

					<div class="form-group">
						<div class="col-sm-2"></div>
						<div class="col-sm-5">
							{{Form::submit(trans('form.save'), array('class' => 'btn btn-primary btn-lg'))}}
							{{Form::button(trans('form.cancel'), array('class' => 'btn btn-default btn-lg', 'id' => 'cancel'))}}
						</div>
					</div>

					{{Form::hidden('id', (isset($taxonomy->id))? $taxonomy->id : 0, array('id' => 'id'))}}
					{{Form::hidden('type', $type, array('id' => 'type'))}}
				{{Form::close()}}
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
	$("button#cancel").click(function(event) {
		/* Act on the event */
		var url = '{{URL::to('admin/'. $type . '/')}}';

		window.location = url;
	});
});
</script>